# encoding: utf-8

import paho.mqtt.client as mqtt

HOST = "121.41.86.151"
PORT = 1883


def mqtt_publish(username, password, door_number, msg):
    client = mqtt.Client()
    client.username_pw_set(username, password)
    client.connect(HOST, PORT, 60)
    info = client.publish("esp32/automatic_door_opening/" + door_number, msg, 2)
    return
